package com.vcredit.creditcat.enumtype;

public enum ResourceTypeEnum {
  IMG(1, "images"), AUDIO(2, "audios"), FILE(3, "files");

  private Integer code;
  private String desc;

  private ResourceTypeEnum(Integer code, String desc) {
    this.code = code;
    this.desc = desc;
  }

  public Integer getCode() {
    return code;
  }

  public String getDesc() {
    return desc;
  }

  public String getMediaType() {
    String result = "";
    switch (code) {
      case 1: {
        result = "image/jpeg";
        break;
      }
      default: {
        result = "text/html";
        break;
      }
    }
    return result;
  }

}
